var gulp = require('gulp'),
    minifycss = require('gulp-minify-css'),
    concat = require('gulp-concat'),
    uglify = require('gulp-uglify'),
    rename = require('gulp-rename'),
    clean = require('gulp-clean'),
    del = require('del');

gulp.task('js', function () {
    return gulp.src('asset/js/area.js')
        .pipe(rename({suffix: '.min'}))
        .pipe(uglify())
        .pipe(gulp.dest('public/js'));
});

gulp.task('css', function () {
    return gulp.src('static/home/css/*.css')
        //.pipe(rename({suffix: '.min'}))
        .pipe(minifycss())
        .pipe(gulp.dest('static/home/css/min'));
});

gulp.task('watch', function () {
    gulp.watch('asset/js/*.js', ['js']);
});

gulp.task('clean', function () {
    return gulp.src(['static/home/css/min'], {read: false})
        .pipe(clean());
});
